home *** CD-ROM | disk | FTP | other *** search
INI File | 2001-09-19 | 27.9 KB | 801 lines |
- ;
- ; rcsId_oemnadvm = "$Id: oemnadvm.inf,v 1.1.1.1 2000/05/24 04:14:13 yoel Exp $";
- ;
- ; VMware VMnet NDIS driver installation file.
- ; Install NDIS adapter and associated DHCP service.
- ;
-
- [Identification]
- OptionType = NetAdapter
-
- ;
- ; We are x86 hardware independent but have no way of
- ; saying that so just list the possible buses.
- ;
- [PlatformsSupported]
- ISA
- EISA
- PCI
- MCA
-
- ;
- ; Our adapter types correspond to the possible VMnet
- ; hubs we can bind to. This lets folks select additional
- ; adapters for custom networking configs by selecting
- ; from the "Add Adapters" list in the NCPA.
- ;
- [Options]
- VMnet0
- VMnet1
- VMnet2
- VMnet3
- VMnet4
- VMnet5
- VMnet6
- VMnet7
- VMnet8
- VMnet9
-
- [FileConstants]
- UtilityInf = "UTILITY.INF"
- subroutineinf = "SUBROUTN.INF"
- ProductSoftwareImagePath = "%SystemRoot%\System32\drivers\vmnetx.sys"
- ProductSoftwareUpgradePath = "\SystemRoot\System32\drivers\vmnetx.sys"
- Exit_Code = 0
- NetworkCardsKey = $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards\"
-
- Manufacturer = "VMware, Inc."
- ProductSoftwareName = "VMnetx"
- ProductSoftwareDependency = {"VMnet"}
- SoftwareType = "driver"
- NetRuleSoftwareType = "VMnetxSys ndisDriver VMnetxDriver"
- NetRuleSoftwareUse = $(SoftwareType)
- NetRuleSoftwareBindForm = """VMnetxSys"" yes no container"
- NetRuleSoftwareClass = {"VMnetxDriver basic"}
- NetRuleSoftwareBindable = {"VMnetxDriver VMnetxAdapter non exclusive 100"}
- ProductHardwareName = "VMnetx"
- NetRuleHardwareBindForm = " yes yes container"
-
- ProductKeyName = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductSoftwareName)"\CurrentVersion"
-
- FunctionTitle = "VMware Virtual Ethernet Adapter Setup"
- ProductSoftwareDescription = "VMware Virtual Ethernet Adapter Driver"
- ProductSoftwareTitle = "VMware Virtual Ethernet Adapter Driver"
- ProductMajorVersion = "1"
- ProductMinorVersion = "0"
- ProductVersion = $(ProductMajorVersion)"."$(ProductMinorVersion)
-
- NetRuleHardwareType = "VMnetx VMnetxAdapter"
- NetRuleHardwareClass = {"VMnetxAdapter basic"}
-
- ProductHardwareTitle = "VMware Virtual Ethernet Adapter"
- ProductHardwareDescription = "VMware Virtual Ethernet Adapter"
-
- DHCPSoftwareName = "VMnetDHCP"
- DHCPSoftwareTitle = "VMware Host-Only DHCP Server"
- DHCPSoftwareImagePath = "%SystemRoot%\System32\vmnetdhcp.exe"
- DHCPSoftwareDependency = {"VMnet"}
- DHCPSoftwareType = "service"
- DHCPSoftwareDescription = "VMware Host-Only DHCP Service"
- DHCPSoftwareDisplayName = "VMnet DHCP Server"
- DHCPSoftwareMajorVersion= "2"
- DHCPSoftwareMinorVersion= "0"
- DHCPSotftwareVersion = $(DHCPSoftwareMajorVersion)"."$(DHCPSoftwareMinorVersion)
- DHCPSoftwareKeyName = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(DHCPSoftwareName)"\CurrentVersion"
- DHCPSoftwareConfFile = "%SystemRoot%\System32\vmnetdhcp.conf"
- DHCPSoftwareLeaseFile = "%SystemRoot%\System32\vmnetdhcp.leases"
- VMwareDeleteKeyName = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\VMware for Windows NT\UninstallFiles"
-
- [GeneralConstants]
- from = ""
- to = ""
- KeyNull = ""
- RegistryErrorIndex = NO_ERROR
- KeyProduct = ""
- TRUE = 1
- FALSE = 0
- NoTitle = 0
- OldVersionExisted = $(FALSE)
- NT400VersionConstant = "(4.0)"
-
- [date]
- Now = {} ? $(!LIBHANDLE) GetSystemDate
-
-
- [Identify]
- read-syms Identification
- set Status = STATUS_SUCCESSFUL
- set Identifier = $(OptionType)
- set Media = #("Source Media Descriptions", 1, 1)
- Return $(Status) $(Identifier) $(Media)
-
- [ReturnOptions]
- set Status = STATUS_FAILED
- set OptionList = {}
- set OptionTextList = {}
- set LanguageList = ^(LanguagesSupported, 1)
- Ifcontains(i) $($0) in $(LanguageList)
- ifstr(i) $($1) == ""
- goto returnoptions
- endif
- set PlatformList = ^(PlatformsSupported, 1)
- Ifcontains(i) $($1) in $(PlatformList)
- goto returnoptions
- else
- set Status = STATUS_NOTSUPPORTED
- goto finish_ReturnOptions
- endif
- else
- set Status = STATUS_NOLANGUAGE
- goto finish_ReturnOptions
- endif
-
- returnoptions = +
- set OptionList = ^(Options, 1)
- set OptionTextList = ^(OptionsText$($0), 1)
- set Status = STATUS_SUCCESSFUL
-
- finish_ReturnOptions = +
- Return $(Status) $(OptionList) $(OptionTextList)
-
- ;
- ; Check for a previously installed VMnet NDIS adapter. This is
- ; cribbed from IsNetCardAlreadyInstalled but differs in that we
- ; have no bus number and card slot to use in identifying adapters;
- ; instead we use the VMnet device we're bound to.
- ;
- [InitBaseVars]
- MAXIMUM_ALLOWED = 33554432
- KeyNull = ""
- RegistryErrorIndex = NO_ERROR
- CurrentControlSet = "SYSTEM\CurrentControlSet"
- ServicesBaseName = $(CurrentControlSet)"\Services"
- NetworkCardKeyName = $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards"
- [IsVMNetCardAlreadyInstalled]
- read-syms InitBaseVars
- set AlreadyExisted = "NO"
- set VMnet = $($0)
- set Description = $($1)
- set Product = $($2)
- set SkipDescriptionCheck = $($3)
- ifstr(i) $(SkipDescriptionCheck) == ""
- set SkipDescriptionCheck = "NO"
- endif
- OpenRegKey $(!REG_H_LOCAL) "" $(NetworkCardKeyName) $(MAXIMUM_ALLOWED) IE_KeyNetcards
- Ifstr $(IE_KeyNetcards) == $(KeyNull)
- Debug-Output "OEMNADVM.INF: OpenRegKey of "$(NetworkCardKeyName)" failed, RegLastError "$(RegLastError)
- set RegistryErrorIndex = UNABLE_OPEN_NETWORKCARD_SECTION
- goto IE_Return
- endif
- EnumRegKey $(IE_KeyNetcards) IE_KeyNameList
- ForListDo $(IE_KeyNameList)
- set IE_KeyName = *($($),1)
- OpenRegKey $(IE_KeyNetcards) "" $(IE_KeyName) $(MAXIMUM_ALLOWED) IE_Card
- Ifstr $(IE_Card) == $(KeyNull)
- set RegistryErrorIndex = UNABLE_OPEN_NETWORKCARD_SECTION
- goto IE_Return
- endif
- GetRegValue $(IE_Card),"Description", DescriptionInfo
- GetRegValue $(IE_Card),"ProductName", ProductNameInfo
- set CardDescription = *($(DescriptionInfo), 4)
- set CardProductName = *($(ProductNameInfo), 4)
- ifstr(i) $(SkipDescriptionCheck) == "YES"
- set CardDescription = $(Description)
- set CardProductName = $(Product)
- endif
- ifstr(i) $(CardDescription) == $(Description)
- ifstr(i) $(CardProductName) == $(Product)
- GetRegValue $(IE_Card), "ServiceName", ServiceNameInfo
- set ServiceName = *($(ServiceNameInfo), 4)
- OpenRegKey $(!REG_H_LOCAL) "" +
- $(ServicesBaseName)"\"$(ServiceName)"\Parameters" +
- $(MAXIMUM_ALLOWED) IE_KeyService
- Ifstr $(IE_KeyService) == $(KeyNull)
- set RegistryErrorIndex = UNABLE_OPEN_NETWORKCARD_SECTION
- goto IE_Return
- endif
- GetRegValue $(IE_KeyService), "VMnet", VMnetInfo
- set CardVMnet = *($(VMnetInfo), 4)
- ifstr(i) $(CardVMnet) == $(VMnet)
- set AlreadyExisted = "YES"
- endif
- endif
- endif
- EndForListDo
- IE_Return = +
- return $(RegistryErrorIndex) $(AlreadyExisted)
-
- [InstallOption]
- set CurrLang = $($0)
- set Option = $($1)
- set SrcDir = $($2)
- set AddCopy = $($3)
- set DoCopy = $($4)
- set DoConfig = $($5)
- set LanguageList = ^(LanguagesSupported, 1)
- Ifcontains(i) $($0) NOT-IN $(LanguageList)
- Return STATUS_NOLANGUAGE
- endif
- set-subst LF = "\n"
- read-syms GeneralConstants
- read-syms FileConstants
- ifstr(i) $(!NTN_Origination) == "NCPA"
- set Continue = "OK"
- endif
- detect date
- set-title $(FunctionTitle)
- set to = Begin
- set from = Begin
- set CommonStatus = STATUS_SUCCESSFUL
- EndWait
-
- Begin = +
- ;
- ; NB: the real work begins here...
- ;
-
- ;
- ; Verify the platform is ok for installation.
- ;
- set CurrentVersionValue = ""
- OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_SoftwareBase)"\Microsoft\Windows Nt\CurrentVersion" $(!REG_KEY_READ) KeyNt
- Ifstr(i) $(KeyNt) != ""
- GetRegValue $(KeyNt) "CurrentVersion" CurrentVersionValue
- CloseRegKey $(KeyNt)
- Endif
- ifstr(i) (*($(CurrentVersionValue),4)) == $(NT400VersionConstant)
- set NDIS_VER = NDIS4
- else-ifstr(i) (*($(CurrentVersionValue),4)) == $(NT500VersionConstant)
- set NDIS_VER = NDIS4
- else
- set Error = "Your version of Windows NT is not supported by this product"
- goto fatal
- endif
-
- ;
- ; Identify what we need to do based on how we were invoked.
- ;
- Ifstr(i) $(!NTN_InstallMode) == deinstall
- ;
- ; Remove adapter and software component.
- ;
- Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer),+
- $(ProductSoftwareName), $(!NTN_RegBase)
- ifint $($ShellCode) != $(!SHELL_CODE_OK)
- goto ShellCodeError
- endif
- set RegistryErrorIndex = $($R0)
- Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
- goto fatalregistry
- endif
-
- ;
- ; Invoke external vnetprobe app to remove the reference to this
- ; adapter in the dhcp config file and, possibly, remove the DHCP
- ; service.
- ;
- RunProgram ExitCode "Windows Directory" "" "vnetprobe.exe" "-u" $(Option)
-
- goto end
- else-Ifstr(i) $(!NTN_InstallMode) == Update
- ;
- ; Update software component.
- ;
-
- ; copy NDIS driver
- install "Install-Option"
- ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
- Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
- ifint $($ShellCode) != $(!SHELL_CODE_OK)
- goto ShellCodeError
- endif
- set Error = $($R0)
- goto fatal
- endif
-
- OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(!REG_KEY_ALL_ACCESS) KeyProduct
- Ifstr $(KeyProduct) != ""
- Shell $(UtilityInf), GetInfFileNameFromRegistry, $(KeyProduct)
- ifint $($ShellCode) != $(!SHELL_CODE_OK)
- goto ShellCodeError
- endif
- set !UG_Filename = $($R0)
- install "Install-INF"
- ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
- goto fatal
- endif
-
- OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\"$(ProductHardwareName) $(!REG_KEY_ALL_ACCESS) KeyService
- Ifstr $(KeyService) == ""
- goto fatalregistry
- endif
- SetRegValue $(KeyService) {ImagePath,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareUpgradePath)}
- CloseRegKey $(KeyService)
-
- OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase) $(!REG_KEY_ALL_ACCESS) KeyNt
- set LoopList = {1,2,3,4,5,6,7,8}
- ForListDo $(LoopList)
- OpenRegKey $(KeyNt) "" $(ProductHardwareName)$($)"\Parameters" $(!REG_KEY_ALL_ACCESS) TestKey
- ifstr $(TestKey) != $(KeyNull)
- OpenRegKey $(!REG_H_LOCAL) "" $(NetworkCardsKey)$($)"\NetRules" $(!REG_KEY_ALL_ACCESS) NetCardKey
- ifstr $(NetCardKey) != $(KeyNull)
- SetRegValue $(NetCardKey) {"InfName",$(NoTitle),$(!REG_VT_SZ),$(!UG_Filename)}
- CloseRegKey $(NetCardKey)
- endif
- CloseRegKey $(TestKey)
- endif
- EndForListDo
- else
- goto fatalregistry
- endif
- goto end
- else-Ifstr(i) $(!NTN_InstallMode) == bind
- Shell "subroutn.inf" SetupMessage, $(!STF_LANGUAGE), STATUS, +
- "Yo! Bind Adapter"
- Return STATUS_SUCCESSFUL
- else-Ifstr(i) $(!NTN_InstallMode) == configure
- Shell "subroutn.inf" SetupMessage, $(!STF_LANGUAGE), STATUS,+
- "Sorry, no properties available just yet!"
- Return STATUS_USERCANCEL
- else
- ;
- ; Install adapter.
- ;
- OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(!REG_KEY_READ) KeyProduct
- Ifstr $(KeyProduct) != $(KeyNull)
- CloseRegKey $(KeyProduct)
- ifstr(i) !(NTN_RegBase) == $(ProductKeyName)
- ifint $($ShellCode) != $(!SHELL_CODE_OK)
- goto ShellCodeError
- endif
- goto end
- else
- set OldVersionExisted = $(TRUE)
- endif
- endif
-
- StartWait
- ; ifint $(OldVersionExisted) == $(FALSE)
- ;
- ; No previously installed version; install the driver
- ; and .inf file as needed.
- ;
- ; Ifstr(i) $(DoCopy) == "YES"
- ; Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) NO
- ; ifint $($ShellCode) != $(!SHELL_CODE_OK)
- ; Goto ShellCodeError
- ; Else-Ifstr(i) $($R0) == STATUS_FAILED
- ; Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
- ; ifint $($ShellCode) != $(!SHELL_CODE_OK)
- ; goto ShellCodeError
- ; endif
- ; set Error = $($R0)
- ; Goto fatal
- ; Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
- ; Goto end
- ; Endif
- ; Endif
- ; install "Install-Option"
- ; ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
- ; Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
- ; ifint $($ShellCode) != $(!SHELL_CODE_OK)
- ; goto ShellCodeError
- ; endif
- ; set Error = $($R0)
- ; goto fatal
- ; endif
- ; endif
-
- ;
- ; Check if the software component is already setup in the registry.
- ;
- OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\"$(ProductHardwareName) $(!REG_KEY_READ) KeyNt
- CloseRegKey $(KeyNt)
- Ifstr(i) $(KeyNt) == ""
- Debug-Output "OEMNADVM.INF: Software component $(ProductHardwareName) not present, add"
-
- ;
- ; NB: Cannot specify needed dependency through this
- ; interface; we do it instead below.
- ;
- Shell $(UtilityInf), AddSoftwareComponent,+
- $(Manufacturer),+
- $(ProductSoftwareName),+
- $(ProductSoftwareName),+
- $(ProductSoftwareTitle),+
- $(STF_CONTEXTINFNAME),+
- $(ProductSoftwareImagePath),+
- "kernel",+
- "NDIS",+
- {},+
- ""
- ifint $($ShellCode) != $(!SHELL_CODE_OK)
- goto ShellCodeError
- endif
-
- set RegistryErrorIndex = $($R0)
- Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
- EndWait
- CloseRegKey $($R1)
- CloseRegKey $($R2)
- CloseRegKey $($R3)
- CloseRegKey $($R4)
- CloseRegKey $($R5)
- goto fatalregistry
- endif
- Set SoftProductKey = $($R1)
- Set SoftNetRuleKey = $($R2)
- Set SoftServiceKey = $($R3)
- Set SoftParameterKey = $($R4)
- Set SoftLinkageKey = $($R5)
-
- set NewValueList = {+
- {SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
- {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
- {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
- {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareTitle)},+
- {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)},+
- {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareName)},+
- {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}+
- }
- Shell $(UtilityInf), AddValueList, $(SoftProductKey), $(NewValueList)
- ifint $($ShellCode) != $(!SHELL_CODE_OK)
- goto ShellCodeError
- endif
- set RegistryErrorIndex = $($R0)
- Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
- EndWait
- CloseRegKey $(SoftProductKey)
- CloseRegKey $(SoftNetRuleKey)
- CloseRegKey $(SoftServiceKey)
- CloseRegKey $(SoftParameterKey)
- CloseRegKey $(SoftLinkageKey)
- goto fatalregistry
- endif
-
- set NewValueList = {+
- {OtherDependencies,$(NoTitle),$(!REG_VT_MULTI_SZ),$(ProductSoftwareDependency)},+
- }
- Shell $(UtilityInf), AddValueList, $(SoftLinkageKey), $(NewValueList)
- ifint $($ShellCode) != $(!SHELL_CODE_OK)
- goto ShellCodeError
- endif
- set RegistryErrorIndex = $($R0)
- Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
- EndWait
- CloseRegKey $(SoftProductKey)
- CloseRegKey $(SoftNetRuleKey)
- CloseRegKey $(SoftServiceKey)
- CloseRegKey $(SoftParameterKey)
- CloseRegKey $(SoftLinkageKey)
- goto fatalregistry
- endif
-
- set NewValueList = {+
- {type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareType)},+
- {use,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareUse)}, +
- {bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareBindForm)}, +
- {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareClass)}, +
- {bindable,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareBindable)}, +
- {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}+
- }
- Shell $(UtilityInf), AddValueList, $(SoftNetRuleKey), $(NewValueList)
- ifint $($ShellCode) != $(!SHELL_CODE_OK)
- goto ShellCodeError
- endif
- set RegistryErrorIndex = $($R0)
- CloseRegKey $(SoftProductKey)
- CloseRegKey $(SoftNetRuleKey)
- CloseRegKey $(SoftServiceKey)
- CloseRegKey $(SoftParameterKey)
- CloseRegKey $(SoftLinkageKey)
- Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
- EndWait
- goto fatalregistry
- endif
- else
- Debug-Output "OEMNADVM.INF: Software component $(ProductHardwareName) already present"
- endif
-
- ;
- ; Check if the DHCP service is already setup in the registry.
- ;
- OpenRegKey $(!REG_H_LOCAL) "" $(DHCPSoftwareKeyName) $(!REG_KEY_ALL_ACCESS) KeyService
- Ifstr(i) $(KeyService) == $(KeyNull)
- Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
- $(DHCPSoftwareName), +
- $(DHCPSoftwareName), +
- $(DHCPSoftwareDisplayName), +
- $(STF_CONTEXTINFNAME),+
- $(DHCPSoftwareImagePath), +
- "serviceauto",+
- "",+
- {"VMnet"},+
- "",+
- $(DHCPSoftwareImagePath),+
- 7,+
- "Application"
- ifint $($ShellCode) != $(!SHELL_CODE_OK)
- Debug-Output "OEMNADVM.INF: InstallVMnetDHCPService : ShellCode error"
- return STATUS_FAILED
- endif
- set RegistryErrorIndex = $($R0)
- set ProductKey = $($R1)
- set RuleKey = $($R2)
- CloseRegKey $($R3)
- set ParameterKey = $($R4)
- CloseRegKey $($R5)
-
- set NewValueList = {+
- {SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(DHCPSoftwareType)},+
- {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(DHCPSoftwareMajorVersion)},+
- {Title,$(NoTitle),$(!REG_VT_SZ),$(DHCPSoftwareTitle)},+
- {Description,$(NoTitle),$(!REG_VT_SZ),$(DHCPSoftwareDescription)},+
- {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(DHCPSoftwareMinorVersion)},+
- {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}+
- }
- Shell $(UtilityInf), AddValueList, $(ProductKey), $(NewValueList)
- CloseRegKey $(ProductKey)
- ifint $($ShellCode) != $(!SHELL_CODE_OK)
- Debug-Output "OEMNADVM.INF: ShellCode error. Cannot add keys to VMnetDHCP"
- goto ShellCodeError
- endif
- set RegistryErrorIndex = $($R0)
- Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
- EndWait
- Debug-Output "OEMNADVM.INF: InstallVMnetDHCPService: Registry error: product key"
- set Status = STATUS_FAILED
- endif
-
- set NewValueList = {+
- {InfOption,$(NoTitle),$(!REG_VT_SZ),"VMnetDHCP"}+
- }
- Shell $(UtilityInf), AddValueList, $(RuleKey), $(NewValueList)
- CloseRegKey $(RuleKey)
- ifint $($ShellCode) != $(!SHELL_CODE_OK)
- Debug-Output "OEMNADVM.INF: ShellCode error. Cannot add keys to VMnetDHCP rules"
- goto ShellCodeError
- endif
- set RegistryErrorIndex = $($R0)
- Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
- EndWait
- Debug-Output "OEMNADVM.INF: InstallVMnetDHCPService: Registry error: rule key"
- set Status = STATUS_FAILED
- endif
-
- set NewValueList = {+
- {ConfFile,$(NoTitle),$(!REG_VT_EXPAND_SZ),$(DHCPSoftwareConfFile)},+
- {LeaseFile,$(NoTitle),$(!REG_VT_EXPAND_SZ),$(DHCPSoftwareLeaseFile)}+
- }
- Shell $(UtilityInf), AddValueList, $(ParameterKey), $(NewValueList)
- CloseRegKey $(ParameterKey)
- ifint $($ShellCode) != $(!SHELL_CODE_OK)
- Debug-Output "OEMNADVM.INF: ShellCode error. Cannot add keys to VMnetDHCP parameters"
- goto ShellCodeError
- endif
- set RegistryErrorIndex = $($R0)
- Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
- EndWait
- Debug-Output "OEMNADVM.INF: InstallVMnetDHCPService: Registry error: parameter key"
- set Status = STATUS_FAILED
- endif
-
- OpenRegKey $(!REG_H_LOCAL) "" $(VMwareDeleteKeyName) $(!REG_KEY_ALL_ACCESS) DeleteFilesKey
- Ifstr(i) $(DeleteFilesKey) == $(KeyNull)
- CreateRegKey $(!REG_H_LOCAL) {$(VMwareDeleteKeyName),0,GenericClass} "" +
- $(!REG_KEY_ALL_ACCESS) "" DeleteFilesKey
- endif
- Ifstr(i) $(DeleteFilesKey) != $(KeyNull)
- set NewValueList = {+
- {$(DHCPSoftwareConfFile),$(NoTitle),$(!REG_VT_DWORD),0},+
- {$(DHCPSoftwareLeaseFile),$(NoTitle),$(!REG_VT_DWORD),0}+
- }
- Shell $(UtilityInf), AddValueList, $(DeleteFilesKey), $(NewValueList)
- CloseRegKey $(DeleteFilesKey)
- ifint $($ShellCode) != $(!SHELL_CODE_OK)
- Debug-Output "OEMNADVM.INF: ShellCode error. Cannot add VMnet DHCP config files to delete list"
- goto ShellCodeError
- endif
- set RegistryErrorIndex = $($R0)
- Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
- EndWait
- Debug-Output "OEMNADVM.INF: InstallVMnetDHCPService: Registry error: delete files key"
- set Status = STATUS_FAILED
- endif
- else
- Debug-Output "OEMNADVM.INF: Could not/create open "$(VMwareDeleteKeyName)" key, RegLastError "$(RegLastError)
- endif
- else
- Debug-Output "OEMNADVM.INF: VMnetDHCP service already present"
- endif
- Ifstr(i) $(KeyService) != $(KeyNull)
- CloseRegKey $(KeyService)
- endif
- EndWait
-
- ;
- ; Check if the adapter is already setup in the registry.
- ;
- Shell "", IsVMNetCardAlreadyInstalled, "\DosDevices\"$(Option),+
- $(ProductHardwareDescription), $(ProductHardwareName)
- ifint $($ShellCode) != $(!SHELL_CODE_OK)
- goto ShellCodeError
- endif
- Debug-Output "OEMNADVM.INF: IsVMNetCardAlreadyInstalled returns $($R0), $($R1)"
- ifstr $($R0) != "NO_ERROR"
- set Error = $($R0)
- goto fatal
- endif
- ifstr(i) $($R1) == "NO"
- Debug-Output "OEMNADVM.INF: Adapter not present, install"
- ;
- ; Adapter was not installed; do the "hardware" part of the install
- ;
- Shell $(UtilityInf), AddHardwareComponent, $(ProductHardwareName),+
- $(STF_CONTEXTINFNAME),$(ProductKeyName)
- ifint $($ShellCode) != $(!SHELL_CODE_OK)
- goto ShellCodeError
- endif
- set RegistryErrorIndex = $($R0)
- Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
- EndWait
- CloseRegKey $($R1)
- CloseRegKey $($R2)
- CloseRegKey $($R3)
- goto fatalregistry
- endif
- set HardNetCardKey = $($R1)
- set HardNetRuleKey = $($R2)
- set HardParameterKey = $($R3)
- set AdapterNumber = $($R4) ; allocated adapter number
-
- ;
- ; Setup miscellaneous stuff.
- ;
- set NewValueList = {+
- {Manufacturer,$(NoTitle),$(!REG_VT_SZ),$(Manufacturer)},+
- {Title,$(NoTitle),$(!REG_VT_SZ),"["$($R4)"] "$(ProductHardwareTitle)" ("$(Option)")"},+
- {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareDescription)},+
- {ProductName,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareName)},+
- {ServiceName,$(NoTitle),$(!REG_VT_SZ),$($R5)},+
- {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}+
- }
- Shell $(UtilityInf), AddValueList, $(HardNetCardKey), $(NewValueList)
- ifint $($ShellCode) != $(!SHELL_CODE_OK)
- goto ShellCodeError
- endif
-
- ;
- ; Mark adapter as supporting Ethernet media
- ; and setup binding to corresponding VMnet device.
- ;
- Set NewValueList = {+
- {MediaType,$(NoTitle),$(!REG_VT_DWORD),1},+
- {VMnet,$(NoTitle),$(!REG_VT_SZ),"\DosDevices\"$(Option)},+
- }
- Shell $(UtilityInf), AddValueList, $(HardParameterKey), $(NewValueList)
- ifint $($ShellCode) != $(!SHELL_CODE_OK)
- goto ShellCodeError
- endif
-
- ;
- ; Invoke external vnetprobe app to probe for an available
- ; Private IP address. The user can override this later;
- ; otherwise they'll be prompted during the binding process
- ; and (probably) be confused.
- ;
- RunProgram ExitCode "Windows Directory" "" "vnetprobe.exe" "-i" $(Option)
-
- ;
- ; Setup hardware-related binding rules.
- ;
- set TempProdName = """"$(ProductHardwareName)$(AdapterNumber)""""
- set TempBindForm = $(TempProdName)$(NetRuleHardwareBindForm)
- set NewValueList = {+
- {type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleHardwareType)},+
- {bindform,$(NoTitle),$(!REG_VT_SZ),$(TempBindForm)}, +
- {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleHardwareClass)}, +
- {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}+
- }
- Shell $(UtilityInf), AddValueList, $(HardNetRuleKey), $(NewValueList)
- ifint $($ShellCode) != $(!SHELL_CODE_OK)
- goto ShellCodeError
- endif
- CloseRegKey $(HardNetCardKey)
- CloseRegKey $(HardNetRuleKey)
- CloseRegKey $(HardParameterKey)
-
- EndWait
-
- return STATUS_SUCCESSFUL
- else
- Debug-Output "OEMNADVM.INF: Adapter already present, complain"
- set Error = "The "$(Option)" adapter is already installed!"
- Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), STATUS, $(Error)
- ifint $($ShellCode) != $(!SHELL_CODE_OK)
- goto ShellCodeError
- endif
- return STATUS_USRCANCEL
- endif
- endif
-
- fatalregistry = +
- Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
- ifint $($ShellCode) != $(!SHELL_CODE_OK)
- goto ShellCodeError
- endif
- set Error = $($R0)
- goto fatal
-
- fatal = +
- ifstr(i) $(Error) == ""
- Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
- ifint $($ShellCode) != $(!SHELL_CODE_OK)
- goto ShellCodeError
- endif
- set Error = $($R0)
- endif
- Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
- ifint $($ShellCode) != $(!SHELL_CODE_OK)
- goto ShellCodeError
- endif
- goto setfailed
-
- ShellCodeError = +
- set DlgType = "MessageBox"
- set STF_MB_TITLE = $(ShellCodeErrorTitle)
- set STF_MB_TEXT = $(ShellCodeErrorText)
- set STF_MB_TYPE = 1
- set STF_MB_ICON = 3
- set STF_MB_DEF = 1
- ui start "Error Message"
- goto setfailed
-
- setfailed = +
- set CommonStatus = STATUS_FAILED
- goto end
-
- end = +
- Return $(CommonStatus)
-
-
- [Install-Option]
- set STF_VITAL = ""
- set STF_OVERWRITE = "VERIFYSOURCEOLDER"
- AddSectionFilesToCopyList Files-$(NDIS_VER) $(SrcDir)WIN32\$(!STF_PLATFORM) $(!STF_WINDOWSSYSPATH)\drivers
- set !STF_NCPA_FLUSH_COPYLIST = TRUE
- CopyFilesInCopyList
- Exit
-
- [Install-INF]
- set STF_VITAL = ""
- AddSectionFilesToCopyList Files-Inf $(SrcDir) $(!STF_WINDOWSSYSPATH)
- set !STF_NCPA_FLUSH_COPYLIST = TRUE
- CopyFilesInCopyList
- Exit
-
- [Source Media Descriptions]
- 1 = "Windows NT Setup Disk #1"
- 2 = "VMware for Windows NT Installation Disk", TAGFILE = DISK1
-
- [Files-NDIS4]
- 3,vmnetx.sys, SIZE=25001
-
- [ProductType]
- STF_PRODUCT = Winnt
-
- [LanguagesSupported]
- ENG
-
- [OptionsTextENG]
- VMnet0 = "VMware Virtual Ethernet Adapter (for host-only support on VMnet0)"
- VMnet1 = "VMware Virtual Ethernet Adapter (for basic host-only support)"
- VMnet2 = "VMware Virtual Ethernet Adapter (for host-only support on VMnet2)"
- VMnet3 = "VMware Virtual Ethernet Adapter (for host-only support on VMnet3)"
- VMnet4 = "VMware Virtual Ethernet Adapter (for host-only support on VMnet4)"
- VMnet5 = "VMware Virtual Ethernet Adapter (for host-only support on VMnet5)"
- VMnet6 = "VMware Virtual Ethernet Adapter (for host-only support on VMnet6)"
- VMnet7 = "VMware Virtual Ethernet Adapter (for host-only support on VMnet7)"
- VMnet8 = "VMware Virtual Ethernet Adapter (for host-only support on VMnet8)"
- VMnet9 = "VMware Virtual Ethernet Adapter (for host-only support on VMnet9)"
-